<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 流年 <liu21st@gmail.com>
// +----------------------------------------------------------------------

// 应用公共文件

/**
 * 根据日期参数，返回该日期的一周的开始和结束日期
 * @param $date
 */
function week_day($date){
    $week_start = date('Y-m-d', strtotime('this week monday', $date));
    $week_end = date('Y-m-d', strtotime('this week sunday', $date));
    $week_array[0] = $week_start;
    $week_array[1] = $week_end;

    return $week_array;
}